<?php
include "include/config.inc.php";
$transDate   = $_GET['fullDate'];
$voucherType = $_GET['voucherType'];
//Voucher No Selection : Start
$selectVoucherNo = "SELECT transDate,voucherType
                      FROM transmaster
                     WHERE transDate = '".$transDate."'
                       AND voucherType = '".$voucherType."'";
$selectVoucherNoResult = mysql_query($selectVoucherNo);
$countRow = mysql_num_rows($selectVoucherNoResult);
$transDateNew = date("d-m-Y", strtotime($transDate));
if($countRow > 0)
{
  $voucherNoCount = $countRow + 1;
  if($voucherNoCount < 10)
  {
    $voucherNoSet = $transDateNew.'-0'.$voucherNoCount;
  }
  else
  {
  	$voucherNoSet = $transDateNew.'-'.$voucherNoCount;
  }
}
else
{
  $voucherNoSet = $transDateNew.'-01';
}
echo $voucherNoSet;
////Voucher No Selection : End
?>